' GET Dateinr,Satznr / GET (x1,y1)-(x2,y2), Fledvar [(Index[,Index...])]
ELSEIF Command$ = "GET" THEN
GOTO NotImplemented
' GOSUB Marke
ELSEIF Command$ = "GOSUB" THEN
GOSUB DumpLabel
CALL CallLib (-834)'GOSUB_Z_
' GOTO Marke
ELSEIF Command$ = "GOTO" THEN
GOSUB DumpLabel
CALL CallLib (-840)'GOTO_Z_
' IF Ausdr THEN
' das "THEN" wird nicht erwartet, es wurde schon zuvor entfernt
ELSEIF Command$ = "IF" THEN
ExprFlags = VarINT : GOSUB DumpExpr
StackType = TypeIF : GOSUB Push
CALL CreateLabel
Stack$(StackPointer,0) = Ergebnis$
CALL CreateLabel
Stack$(StackPointer,1) = Ergebnis$
CALL SubDumpLabel (Stack$(StackPointer,1))
CALL CallLib (-912)'IF_IZ_
' INPUT ["Text";] Var[,Var]...
ELSEIF Command$ = "INPUT" THEN
IF FirstWord <= LastWord AND Word$(FirstWord) = "#" THEN
GOSUB SkipOneWord
ExprFlags = VarINT : GOSUB DumpExpr
GOSUB SkipKomma
DidRead = FALSE
WHILE FirstWord <= LastWord OR DidRead = FALSE
IF DidRead THEN
GOSUB SkipKomma
ELSE
DidRead = TRUE
END IF
CALL CallLib (-600)'FILEINPUT_I_IT
StackFlags = VarTEXT : GOSUB DumpSetVar
WEND
CALL CallLib (-684)'FORGET_I_
ELSE
IF FirstWord <= LastWord AND LEFT$(Word$(FirstWord),1) = CHR$(34) THEN
ExprFlags = VarTEXT : GOSUB DumpExpr
CALL CallLib (-1782)'PRINT_T_
IF FirstWord <= LastWord AND INSTR(";,",Word$(FirstWord)) THEN
IF Word$(FirstWord) = ";" THEN CALL CallLib (-1740)'PRINTQMARK__
GOSUB SkipOneWord
GOSUB HandleInputLine
ELSE
GOTO SyntaxError
END IF
ELSE
CALL CallLib (-1740)'PRINTQMARK__
GOSUB HandleInputLine
END IF
END IF
' KILL Dateiangabe
ELSEIF Command$ = "KILL" THEN
ExprFlags = VarTEXT : GOSUB DumpExpr
CALL CallLib (-972)'KILL_T_
' [LET] Var = Ausdruck
ELSEIF Command$ = "LET" THEN
SafeFirstWord = FirstWord
GOSUB SkipOneVar
IF FirstWord > LastWord OR Word$(FirstWord) <> "=" THEN CALL SomeError ("Expected '='",WordPos(FirstWord)) : EXIT SUB
GOSUB SkipOneWord
ExprFlags = VarTEXT OR VarINT OR VarLONG OR VarREAL OR VarDOUB : GOSUB DumpExpr
FirstWord = SafeFirstWord
StackFlags = Ergebnis : GOSUB DumpSetVar
FirstWord = LastWord+1
' LIBRARY "Dateiname" / LIBRARY CLOSE
ELSEIF Command$ = "LIBRARY" THEN
IF FirstWord <= LastWord AND Word$(FirstWord) = "CLOSE" THEN
GOSUB SkipOneWord
CALL CallLib (-1020)'LIBRARYCLOSE__
ELSE
ExprFlags = VarTEXT : GOSUB DumpExpr
CALL CallLib (-1026)'LIBRARY_T_
END IF
' LINE INPUT #Dateinr,Zeikettenvar
' LINE INPUT ["Text";]Zeikettvar
' LINE [[STEP] (x1,y1)-[STEP] (x2,y2)[,Farbe][,B[F]]]
ELSEIF Command$ = "LINE" THEN
IF FirstWord <= LastWord AND Word$(FirstWord) = "INPUT" THEN
GOSUB SkipOneWord
IF FirstWord <= LastWord AND Word$(FirstWord) = "#" THEN
GOSUB SkipOneWord
ExprFlags = VarINT : GOSUB DumpExpr
GOSUB SkipKomma
CALL CallLib (-606)'FILELINEINPUT_I_T
StackFlags = VarTEXT : GOSUB DumpSetVar
ELSE
IF FirstWord <= LastWord AND LEFT$(Word$(FirstWord),1) = CHR$(34) THEN
ExprFlags = VarTEXT : GOSUB DumpExpr
CALL CallLib (-1782)'PRINT_T_
IF FirstWord > LastWord OR (Word$(FirstWord) <> ";" AND Word$(FirstWord) <> ",") THEN SyntaxError
GOSUB SkipOneWord
END IF
CALL CallLib (-1044)'LINEINPUT__T
StackFlags = VarTEXT : GOSUB DumpSetVar
END IF
ELSE
IF FirstWord > LastWord OR Word$(FirstWord) <> "-" THEN
GOSUB DumpGfxPoint
ELSE
CALL SubDumpVar ("0",VarINT+VarCONST,-1)
CALL SubDumpVar ("0",VarINT+VarCONST,-1)
CALL CallLib (-828)'GFXSTEP_II_II
END IF
IF FirstWord > LastWord OR Word$(FirstWord) <> "-" THEN SyntaxError
GOSUB SkipOneWord
GOSUB DumpGfxPoint
IF FirstWord <= LastWord THEN GOSUB SkipKomma
IF FirstWord > LastWord OR Word$(FirstWord) = "," THEN
CALL CallLib (-714)'FRONTCOLOR__I
ELSE
ExprFlags = VarINT : GOSUB DumpExpr
END IF
IF FirstWord > LastWord THEN
CALL CallLib (-1050)'LINE_IIIII_
ELSE
GOSUB SkipKomma
IF FirstWord = LastWord AND Word$(FirstWord) = "B" THEN
GOSUB SkipOneWord
CALL CallLib (-1038)'LINEB_IIIII_
ELSEIF FirstWord = LastWord AND Word$(FirstWord) = "BF" THEN
GOSUB SkipOneWord
CALL CallLib (-1032)'LINEBF_IIIII_
ELSE
GOTO SyntaxError
END IF
END IF
END IF
' LIST [Zeile1][-[Zeile2]][,Dateinang]
ELSEIF Command$ = "LIST" THEN
GOTO NotCompilable
' LLIST [Zeile1][-[Zeile2]]
ELSEIF Command$ = "LLIST" THEN
GOTO NotCompilable
' LOAD [Dateiangabe[,R]]
ELSEIF Command$ = "LOAD" THEN
GOTO NotCompilable
' LOCATE [Zeile][,Spalte]
ELSEIF Command$ = "LOCATE" THEN
IF FirstWord <= LastWord THEN
IF Word$(FirstWord) <> "," THEN
ExprFlags = VarINT : GOSUB DumpExpr
CALL CallLib (-1062)'LOCATEY_I_
END IF
IF FirstWord <= LastWord THEN GOSUB SkipKomma
IF FirstWord <= LastWord THEN
ExprFlags = VarINT : GOSUB DumpExpr
CALL CallLib (-1056)'LOCATEX_I_
END IF
END IF
' LPRINT [Liste von Ausdr][;]
ELSEIF Command$ = "LPRINT" THEN
SendReturn = TRUE
WHILE FirstWord <= LastWord
IF Word$(FirstWord) = ";" THEN
GOSUB SkipOneWord
SendReturn = FALSE
END IF
IF FirstWord <= LastWord AND Word$(FirstWord) = "," THEN
GOSUB SkipOneWord
CALL CallLib (-1104)'LPRINTTAB__
SendReturn = FALSE
END IF
IF FirstWord <= LastWord THEN
ExprFlags = VarTEXT OR VarINT OR VarLONG OR VarREAL OR VarDOUB : GOSUB DumpExpr
IF Ergebnis = VarTEXT THEN
CALL CallLib (-1134)'LPRINT_T_
ELSEIF Ergebnis = VarINT THEN
CALL CallLib (-1116)'LPRINT_I_
ELSEIF Ergebnis = VarLONG THEN
CALL CallLib (-1122)'LPRINT_L_
ELSEIF Ergebnis = VarREAL THEN
CALL CallLib (-1128)'LPRINT_R_
ELSEIF Ergebnis = VarDOUB THEN
CALL CallLib (-1110)'LPRINT_D_
END IF
SendReturn = TRUE
END IF
WEND
IF SendReturn THEN CALL CallLib (-1098)'LPRINTRETURN__
' MENU Kennung,Punkt,Status[,Titel] / MENU ON / MENU OFF / MENU STOP
ELSEIF Command$ = "MENU" THEN
IF FirstWord <= LastWord AND Word$(FirstWord) = "ON" THEN
GOSUB SkipOneWord
CALL CallLib (-1176)'MENUON__
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "OFF" THEN
GOSUB SkipOneWord
CALL CallLib (-1170)'MENUOFF__
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "STOP" THEN
GOSUB SkipOneWord
CALL CallLib (-1188)'MENUSTOP__
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "RESET" THEN
GOSUB SkipOneWord
CALL CallLib (-1182)'MENURESET__
ELSE
ExprFlags = VarINT : GOSUB DumpExpr
GOSUB SkipKomma
ExprFlags = VarINT : GOSUB DumpExpr
GOSUB SkipKomma
ExprFlags = VarINT : GOSUB DumpExpr
IF FirstWord > LastWord THEN
CALL CallLib (-1200)'MENU_III_
ELSE
GOSUB SkipKomma
ExprFlags = VarTEXT : GOSUB DumpExpr
CALL CallLib (-1194)'MENU_IIIT_
END IF
END IF
' MERGE
ELSEIF Command$ = "MERGE" THEN
GOTO NotCompilable
' MID$(v$,n[,m]) = x$
ELSEIF Command$ = "MID$" THEN
ThreePars = FALSE
IF FirstWord > LastWord OR Word$(FirstWord) <> "(" THEN SyntaxError
GOSUB SkipOneWord
VarFlags = VarTEXT : GOSUB DumpVarPointer
GOSUB SkipKomma
ExprFlags = VarINT : GOSUB DumpExpr
IF FirstWord <= LastWord AND Word$(FirstWord) = "," THEN
GOSUB SkipKomma
ThreePars = TRUE
ExprFlags = VarINT : GOSUB DumpExpr
END IF
IF FirstWord > LastWord OR Word$(FirstWord) <> ")" THEN SyntaxError
GOSUB SkipOneWord
IF FirstWord > LastWord OR Word$(FirstWord) <> "=" THEN SyntaxError
GOSUB SkipOneWord
ExprFlags = VarTEXT : GOSUB DumpExpr
IF ThreePars THEN
CALL CallLib (-1938)'SETMID_tIIT_
ELSE
CALL CallLib (-1944)'SETMID_tIT_
END IF
' MOUSE ON / MOUSE OFF / MOUSE STOP
ELSEIF Command$ = "MOUSE" THEN
IF FirstWord <= LastWord AND Word$(FirstWord) = "ON" THEN
GOSUB SkipOneWord
CALL CallLib (-1266)'MOUSEON__
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "OFF" THEN
GOSUB SkipOneWord
CALL CallLib (-1260)'MOUSEOFF__
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "STOP" THEN
GOSUB SkipOneWord
CALL CallLib (-1272)'MOUSESTOP__
ELSE
GOTO SyntaxError
END IF
' NAME Dateiangabe AS Dateiname
ELSEIF Command$ = "NAME" THEN
ExprFlags = VarTEXT : GOSUB DumpExpr
IF FirstWord > LastWord OR Word$(FirstWord) <> "AS" THEN SyntaxError
GOSUB SkipOneWord
ExprFlags = VarTEXT : GOSUB DumpExpr
CALL CallLib (-1308)'NAME_TT_
' Damit IF ... THEN nicht zu lang wird
ELSE
NotFound = NotFound+1
END IF
' NEW
IF Command$ = "NEW" THEN
GOTO NotCompilable
' NEXT [Var][,Var]...
ELSEIF Command$ = "NEXT" THEN
ExpectKomma = FALSE
WHILE FirstWord <= LastWord OR ExpectKomma = FALSE
IF ExpectKomma THEN
GOSUB SkipKomma
ELSE
ExpectKomma = TRUE
END IF
StackType = TypeFOR : GOSUB Pull
IF FirstWord <= LastWord AND Word$(FirstWord) <> "," THEN
IF IsVar(FirstWord) = FALSE OR (WordVarFlags(FirstWord) AND (VarCONST OR VarTEXT)) <> 0 THEN CALL SomeError ("Expected numeric variable",WordPos(FirstWord)) : EXIT SUB
IF Word$(FirstWord) <> Stack$(StackPointer+1,1) THEN CALL SomeError ("Not the same variable like that in the FOR-command",WordPos(FirstWord)) : EXIT SUB
IF FirstWord <= LastWord AND Word$(FirstWord) = "BREAK" THEN
GOSUB SkipOneWord
IF FirstWord > LastWord OR Word$(FirstWord) <> "GOSUB" THEN SyntaxError
GOSUB SkipOneWord
GOSUB DumpLabel
CALL CallLib (-1566)'ONBREAKGOSUB_Z_
' ON COLLISION GOSUB Marke
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "COLLISION" THEN
GOSUB SkipOneWord
IF FirstWord > LastWord OR Word$(FirstWord) <> "GOSUB" THEN SyntaxError
GOSUB SkipOneWord
GOSUB DumpLabel
CALL CallLib (-1572)'ONCOLLISIONGOSUB_Z_
' ON ERROR GOTO Marke
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "ERROR" THEN
GOSUB SkipOneWord
IF FirstWord > LastWord OR Word$(FirstWord) <> "GOTO" THEN SyntaxError
GOSUB SkipOneWord
GOSUB DumpLabel
CALL CallLib (-1578)'ONERRORGOTO_Z_
' ON MENU GOSUB Marke
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "MENU" THEN
GOSUB SkipOneWord
IF FirstWord > LastWord OR Word$(FirstWord) <> "GOSUB" THEN SyntaxError
GOSUB SkipOneWord
GOSUB DumpLabel
CALL CallLib (-1596)'ONMENUGOSUB_Z_
' ON MOUSE GOSUB Marke
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "MOUSE" THEN
GOSUB SkipOneWord
IF FirstWord > LastWord OR Word$(FirstWord) <> "GOSUB" THEN SyntaxError
GOSUB SkipOneWord
GOSUB DumpLabel
CALL CallLib (-1602)'ONMOUSEGOSUB_Z_
' ON TIMER (n) GOSUB Marke
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "TIMER" THEN
GOSUB SkipOneWord
ExprFlags = VarINT : GOSUB DumpExpr
IF FirstWord > LastWord OR Word$(FirstWord) <> "GOSUB" THEN SyntaxError
GOSUB SkipOneWord
GOSUB DumpLabel
CALL CallLib (-1608)'ONTIMERGOSUB_IZ_
' ON ... GOSUB / GOTO Marke[,Marke]...
ELSE
CALL SubDumpVar ("0",VarINT+VarCONST,-1)
ExprFlags = VarINT : GOSUB DumpExpr
IF FirstWord > LastWord OR (Word$(FirstWord) <> "GOSUB" AND Word$(FirstWord) <> "GOTO") THEN CALL SomeError ("Expected GOTO or GOSUB",WordPos(FirstWord)) : EXIT SUB
IsGoto = Word$(FirstWord) = "GOTO"
GOSUB SkipOneWord
ExpectKomma = FALSE
WHILE FirstWord <= LastWord OR ExpectKomma = FALSE
IF ExpectKomma THEN
GOSUB SkipKomma
ELSE
ExpectKomma = TRUE
END IF
IF FirstWord > LastWord THEN NeedSomethingError
CALL CouldThisBeALabel (FirstWord)
IF Ergebnis = FALSE THEN CALL SomeError ("Expected a label",WordPos(FirstWord)) : EXIT SUB
CALL SubDumpLabel (Word$(FirstWord))
GOSUB SkipOneWord
IF IsGoto THEN
CALL CallLib (-1590)'ONGOTO_IIZ_II
ELSE
CALL CallLib (-1584)'ONGOSUB_IIZ_II
END IF
WEND
CALL CallLib (-684)'FORGET_I_
CALL CallLib (-684)'FORGET_I_
END IF
' OPEN Dateinang FOR Modus1 AS Dateinr
ELSEIF Command$ = "OPEN" THEN
ExprFlags = VarTEXT : GOSUB DumpExpr
OpenModus = 0
IF FirstWord <= LastWord AND Word$(FirstWord) = "FOR" THEN
GOSUB SkipOneWord
IF FirstWord <= LastWord AND Word$(FirstWord) = "OUTPUT" THEN
GOSUB SkipOneWord
OpenModus = 1
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "APPEND" THEN
GOSUB SkipOneWord
OpenModus = 2
ELSEIF FirstWord <= LastWord AND Word$(FirstWord) = "INPUT" THEN
GOSUB SkipOneWord
OpenModus = 3
ELSE
GOTO SyntaxError
END IF
END IF
IF FirstWord > LastWord OR Word$(FirstWord) <> "AS" THEN SyntaxError
GOSUB SkipOneWord
IF FirstWord <= LastWord AND Word$(FirstWord) = "#" THEN GOSUB SkipOneWord
ExprFlags = VarINT : GOSUB DumpExpr
IF OpenModus = 0 THEN
CALL CallLib (-1632)'OPENREADWRITE_TI_
ELSEIF OpenModus = 1 THEN
CALL CallLib (-1626)'OPENOUTPUT_TI_
ELSEIF OpenModus = 2 THEN
CALL CallLib (-1614)'OPENAPPEND_TI_
ELSEIF OpenModus = 3 THEN
CALL CallLib (-1620)'OPENINPUT_TI_
END IF
' OPTION BASE n
ELSEIF Command$ = "OPTION" THEN
IF FirstWord > LastWord OR Word$(FirstWord) <> "BASE" THEN SyntaxError
GOSUB SkipOneWord
ExprFlags = VarINT : GOSUB DumpExpr
GOTO NotImplemented
' PAINT [STEP](x,y) [,Farbe[,Rand]]
ELSEIF Command$ = "PAINT" THEN
GOSUB DumpGfxPoint
IF FirstWord <= LastWord THEN GOSUB SkipKomma
IF FirstWord <= LastWord THEN
ExprFlags = VarINT : GOSUB DumpExpr
ELSE
CALL CallLib (-720)'GETCOLOR0__I
END IF
IF FirstWord <= LastWord THEN GOSUB SkipKomma
IF FirstWord <= LastWord THEN
ExprFlags = VarINT : GOSUB DumpExpr
ELSE
CALL CallLib (-486)'DOUBLE_I_II
END IF
CALL CallLib (-1650)'PAINT_IIII_
' PALETTE Farbe,Rot,Grn,Blau
ELSEIF Command$ = "PALETTE" THEN
ExprFlags = VarINT : GOSUB DumpExpr
GOSUB SkipKomma
ExprFlags = VarREAL : GOSUB DumpExpr
GOSUB SkipKomma
ExprFlags = VarREAL : GOSUB DumpExpr
GOSUB SkipKomma
ExprFlags = VarREAL : GOSUB DumpExpr
CALL CallLib (-1656)'PALETTE_IRRR_
' PATTERN [Lmuster][,Fmuster]
ELSEIF Command$ = "PATTERN" THEN
IF FirstWord <= LastWord THEN
ExprFlags = VarLONG : GOSUB DumpExpr
CALL CallLib (-1662)'PATTERN1_L_
END IF
IF FirstWord <= LastWord THEN GOSUB SkipKomma
IF FirstWord <= LastWord THEN
ExprFlags = VarLONG : GOSUB DumpExpr
CALL CallLib (-1668)'PATTERN2_L_
END IF
' POKE Adresse,m
ELSEIF Command$ = "POKE" THEN
ExprFlags = VarLONG : GOSUB DumpExpr
GOSUB SkipKomma
ExprFlags = VarINT : GOSUB DumpExpr
CALL CallLib (-1710)'POKE_LI_
' POKEL Adresse,m
ELSEIF Command$ = "POKEL" THEN
ExprFlags = VarLONG : GOSUB DumpExpr
GOSUB SkipKomma
ExprFlags = VarLONG : GOSUB DumpExpr
CALL CallLib (-1698)'POKEL_LL_
' POKEW Adresse,m
ELSEIF Command$ = "POKEW" THEN
ExprFlags = VarLONG : GOSUB DumpExpr
GOSUB SkipKomma
ExprFlags = VarINT : GOSUB DumpExpr
CALL CallLib (-1704)'POKEW_LI_
' PRESET [STEP] (x,y)[,Farbe]
ELSEIF Command$ = "PRESET" THEN
GOSUB DumpGfxPoint
IF FirstWord <= LastWord THEN GOSUB SkipKomma
IF FirstWord <= LastWord THEN
ExprFlags = VarINT : GOSUB DumpExpr
ELSE
CALL CallLib (-720)'GETCOLOR0__I
END IF
CALL CallLib (-1734)'PRESET_III_
' PRINT [List von Ausdr]
ELSEIF Command$ = "PRINT" THEN
DoPrintToFile = FirstWord <= LastWord AND Word$(FirstWord) = "#"
IF DoPrintToFile THEN
GOSUB SkipOneWord
ExprFlags = VarINT : GOSUB DumpExpr
GOSUB SkipKomma
END IF
SendReturn = TRUE
WHILE FirstWord <= LastWord
IF Word$(FirstWord) = ";" THEN
GOSUB SkipOneWord
SendReturn = FALSE
ELSEIF Word$(FirstWord) = "," THEN
GOSUB SkipOneWord
IF DoPrintToFile THEN
CALL CallLib (-618)'FILEPRINTTAB_I_I
ELSE
CALL CallLib (-1752)'PRINTTAB__
END IF
SendReturn = FALSE
ELSE
ExprFlags = VarTEXT OR VarINT OR VarLONG OR VarREAL OR VarDOUB : GOSUB DumpExpr
IF DoPrintToFile THEN
IF Ergebnis = VarTEXT THEN
CALL CallLib (-648)'FILEPRINT_IT_I
ELSEIF Ergebnis = VarINT THEN
CALL CallLib (-630)'FILEPRINT_II_I
ELSEIF Ergebnis = VarLONG THEN
CALL CallLib (-636)'FILEPRINT_IL_I
ELSEIF Ergebnis = VarREAL THEN
CALL CallLib (-642)'FILEPRINT_IR_I
ELSEIF Ergebnis = VarDOUB THEN
CALL CallLib (-624)'FILEPRINT_ID_I
END IF
ELSE
IF Ergebnis = VarTEXT THEN
CALL CallLib (-1782)'PRINT_T_
ELSEIF Ergebnis = VarINT THEN
CALL CallLib (-1764)'PRINT_I_
ELSEIF Ergebnis = VarLONG THEN
CALL CallLib (-1770)'PRINT_L_
ELSEIF Ergebnis = VarREAL THEN
CALL CallLib (-1776)'PRINT_R_
ELSEIF Ergebnis = VarDOUB THEN
CALL CallLib (-1758)'PRINT_D_
END IF
END IF
SendReturn = TRUE
END IF
WEND
IF SendReturn THEN
IF DoPrintToFile THEN
CALL CallLib (-612)'FILEPRINTRETURN_I_I
ELSE
CALL CallLib (-1746)'PRINTRETURN__
END IF
END IF
IF DoPrintToFile THEN CALL CallLib (-684)'FORGET_I_
' PSET [STEP] (x,y)[,Farbe]
ELSEIF Command$ = "PSET" THEN
GOSUB DumpGfxPoint
IF FirstWord <= LastWord THEN GOSUB SkipKomma
IF FirstWord <= LastWord THEN
ExprFlags = VarINT : GOSUB DumpExpr
ELSE
CALL CallLib (-720)'GETCOLOR0__I
END IF
CALL CallLib (-1788)'PSET_III_
' PUT [#]Dateinr[,Satznr]
ELSEIF Command$ = "PUT" THEN
GOTO NotImplemented
' RANDOMIZE [n]
ELSEIF Command$ = "RANDOMIZE" THEN
IF FirstWord > LastWord THEN
CALL CallLib (-1800)'RANDOMIZE__
ELSE
ExprFlags = VarINT : GOSUB DumpExpr
CALL CallLib (-1794)'RANDOMIZE_I_
END IF
' READ Var[,Var]...
ELSEIF Command$ = "READ" THEN
ExpectKomma = FALSE
WHILE FirstWord <= LastWord OR ExpectKomma = FALSE
IF FoundOperator(Level) = -1 THEN CALL SomeError ("Operator missing",WordPos(Von(Level))) : Ergebnis = FALSE : EXIT SUB
' Monadischer Operator
IF FuncType(OperatorNum(FoundOperator(Level))) = 1 THEN
IF FoundOperator(Level) <> Von(Level) THEN CALL SomeError ("Parameter before monadic operator not allowed",WordPos(FoundOperator(Level))) : Ergebnis = FALSE : EXIT SUB
GOSUB GetNewLevel
Von(NewLevel) = FoundOperator(Level)+1
Bis(NewLevel) = Bis(Level)
GOSUB AddNewLevelReturnType
END IF
' Dyadischer Operator
IF FuncType(OperatorNum(FoundOperator(Level))) = 2 THEN
GOSUB GetNewLevel
Von(NewLevel) = Von(Level)
Bis(NewLevel) = FoundOperator(Level)-1
GOSUB AddNewLevelReturnType
GOSUB GetNewLevel
Von(NewLevel) = FoundOperator(Level)+1
Bis(NewLevel) = Bis(Level)
GOSUB AddNewLevelReturnType
END IF
' Eine Funktion oder Systemvariable
IF FuncType(OperatorNum(FoundOperator(Level))) = 3 THEN
IF FoundOperator(Level) <> Von(Level) THEN CALL SomeError ("Parameter before function not allowed",FoundOperator(Level)) : Ergebnis = FALSE : EXIT SUB
ReadPointer(Level) = FoundOperator(Level)+1
' sind Parameter vorhanden?
IF ReadPointer(Level) <= Bis(Level) THEN
' Klammern entfernen
IF Word$(ReadPointer(Level)) <> "(" THEN CALL SomeError ("Expected '('",WordPos(ReadPointer(Level))) : Ergebnis = FALSE : EXIT SUB
ReadPointer(Level) = ReadPointer(Level)+1
IF Word$(Bis(Level)) <> ")" THEN CALL SomeError ("Expected ')'",WordPos(Bis(Level))) : Ergebnis = FALSE : EXIT SUB
Bis(Level) = Bis(Level)-1
' sind noch immer Parameter vorhanden?
IF ReadPointer(Level) <= Bis(Level) THEN
' Testen, ob gleich ein Komma kommt
IF Word$(ReadPointer(Level)) = "," THEN
CALL SomeError ("Empty expression at the beginning of the "+Func$(Von(Level))+"-function",WordPos(ReadPointer(Level))) : Ergebnis = FALSE : EXIT SUB
END IF
WHILE ReadPointer(Level) <= Bis(Level)
IF Word$(ReadPointer(Level)) = "," THEN ReadPointer(Level) = ReadPointer(Level)+1
GOSUB GetNewLevel
Von(NewLevel) = ReadPointer(Level)
CALL GetExprEnd (ReadPointer(Level),Bis(Level))
IF Ergebnis = -1 THEN Ergebnis = FALSE : EXIT SUB
Bis(NewLevel) = Ergebnis
ReadPointer(Level) = Ergebnis+1
GOSUB AddNewLevelReturnType
IF ReadPointer(Level) <= Bis(Level) AND Word$(ReadPointer(Level)) <> "," THEN
FOR a = 0 TO NumVarianten(OperatorNum(FoundOperator(Level)))
IF NumPars(Level) = NumParameter(OperatorNum(FoundOperator(Level)),a) THEN
FOR b = 0 TO NumPars(Level)
c = Possible(OperatorNum(FoundOperator(Level)),a,b)
d = ParType(Level,b)
IF (c AND d) = 0 THEN NotYetFound
NEXT b
VarianteNum(Level) = a
GOTO FoundIt
END IF
NotYetFound:
NEXT a
CALL SomeError (Func$(OperatorNum(FoundOperator(Level)))+"-function is not possible with these parameters",WordPos(FoundOperator(Level))) : Ergebnis = FALSE : EXIT SUB